#include <iostream>
#include <vector>
#include <algorithm>
#include <memory.h>
using namespace std;

int vis[100005], S[100005];

int getf (int x) {
	if (S[x] == x) {
		return x;
	}
	return S[x] = getf(S[x]);
}

void merge (int x, int y) {
	int u = getf(x);
	int v = getf(y);
	if (u != v) {
		S[u] = v;
	}
} 

int main() {
	int n, m;
	while (cin >> n >> m) {
		int x, y;

		for (int i = 0; i <= n; ++i) {
			S[i] = i;
		}

		for (int i = 1; i <= m; ++i) {
			cin >> x >> y;
			merge(x, y);
			++vis[x];
			++vis[y];
		}

		int flag = 0;
		for (int i = 1; i <= n; i++) {
			if (vis[i] % 2 == 1) {
				++flag;
			}
		}

		flag = (flag + 1) / 2;

		if (flag == 0) {
			for (int i = 1; i <= n; i++) {
				if (S[i] == i && vis[i] != 0) {
					++flag;
				}
			}
		}

		if (m == 0) {
			flag = 0;
		}

		cout << flag << endl;
		memset(vis, 0, sizeof(vis));
	}
	return 0;
}